// 隐藏下拉框
window.onload = function () {
  var ul = document.getElementById('ul')
  var yin = document.getElementById('yin')
  var ze = document.getElementById('ze')
  ul.onmouseover = function () {
    yin.style.display = 'block'
    ze.style.display = 'block'
  }
  ul.onmouseout = function () {
    yin.style.display = 'none'
    ze.style.display = 'none'
  }
  // 滚轮事件
  var header = document.getElementsByTagName('header')[0]
  window.onscroll = function (e) {
    var ding = document.getElementById('header-ding')
    var e = e || window.event
    var scrolltop = document.documentElement.scrollTop || document.body.scrollTop
    if (scrolltop > 100) {
      console.log(scrolltop);
      ding.style.height = 360 + 'px'
      ding.style.animation = 'yin 1s'
      ding.style.backgroundImage = 'url(./imgs/bcc13d67-cb88-4ac9-a41a-8276a72d6f4a.png)'
      header.style.height = 360 + 'px'
    }
  }
}
var znleft = document.querySelector('.zn-left').querySelectorAll('div')
var znright = document.querySelector('.zn-right').querySelectorAll('div')
let mask = $('.zzc')

$(function () {
  function fn(class1, class2) {
    $(class1).hover(
      function () {
        $(this).addClass('hover')
        mask.show()
        $(class2).css('transform', 'scale(1)')
      },
      function () {
        mask.hide()
        $(this).removeClass('hover')
        $(class2).css('transform', 'scale(0)')
      }
    )
  }

  fn('.shenhaifeixia', '.hero-shenhaifeixia')

  fn('.zhaoxilieren', '.hero-zhaoxilieren')

  fn('.zhuzai', '.hero-zhuzai')

  fn('.fengxingzhe', '.hero-fengxingzhe')

  fn('.fuchouzhihun', '.hero-fuchouzhihun')

  // 

  fn('.shiwen', '.hero-shiwen')

  fn('.bear', '.hero-bear')

  fn('.bingnv', '.hero-bingnv')

  fn('.cow', '.hero-cow')

  fn('.juntuan', '.hero-juntuan')



  //   。。。

  let moves = {
    delay: 500,
    distance: '50px',
    easing: 'ease-in',
    interval: 300,
    duration: 500,
    opacity: 0
  }

  function anim(dom, origin) {
    ScrollReveal().reveal(dom, { ...moves, origin })
  }

  anim('.section a', 'bottom')
  anim('.section-lun', 'left')
  anim('.section-news', 'right')
  anim('.act-nav', 'left')
  anim('.st ul li', 'bottom')
  anim('.activity-nav > a', 'right')
  anim('.activity-right', 'right')
  anim('.activity-di', 'bottom')
  anim('.zn-left', 'left')
  anim('.zn-contend-zj', 'top')
  anim('.zn-right', 'right')
  anim('.xs-pai', 'bottom')
  anim('.xs-right', 'right')
  anim('.xs-left ul', 'left')
  anim('.xs-left-zo', 'right')
  anim('.dibu', 'left')
})
